package com.conversationboard.api;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.SecurityContext;

import com.conversationboard.site.Site;

/* Input is <SiteInfo></SiteInfo> */

public class SiteInfoProcessor implements Processor {

	public String processXml(String xml, SecurityContext securityContext, HttpServletRequest request) throws ApiException {

		/* The input doesn't matter, so just produce the response */

		String response = "<SiteInfo><UserCount>" + Site.getUserCount() + "</UserCount><ThreadCount>" + Site.getThreadCount() + "</ThreadCount><MessageCount>";
		response = response + Site.getMessageCount() + "</MessageCount><ActiveUsers>" + Site.getCurrentlyActiveUsers() + "</ActiveUsers></SiteInfo>";

		return response;

	}

}
